package com.cfc.personalproject.service.impl;

import com.cfc.personalproject.db.mapper.biz.PlaceBaseMapper;
import com.cfc.personalproject.db.model.biz.PlaceBase;
import com.cfc.personalproject.db.model.biz.PlaceBaseExample;
import com.cfc.personalproject.service.PlaceBaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: anxiaojian
 * @Date: 2020/10/27 15:47
 * @Description:
 */
@Service
public class PlaceBaseServiceImpl implements PlaceBaseService {

    @Autowired
    private PlaceBaseMapper placeBaseMapper;

    @Override
    public PageInfo<PlaceBase> findList(Integer pageIndex,Integer pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        PlaceBaseExample example = new PlaceBaseExample();
        PlaceBaseExample.Criteria criteria = example.createCriteria();
        List<PlaceBase> placeBaseList = placeBaseMapper.selectByExample(example);
        PageInfo<PlaceBase> pageInfo = new PageInfo<PlaceBase>(placeBaseList);
        return pageInfo;
    }

}
